}
}
-static void send_timeoffset_msg(time_t delta)
-{
-
-/* This routine is used to inform another entity that the
- base time offset has changed. For instance, if you
- were using xenstore, you might want to write to the store
- at this point. Or, you might use some other method.
- Whatever you might choose, here's a hook point to implement it.
-
- One item of note is that this delta is in addition to
- any existing offset you might be already using. */
-
- return;
-}
-
static void rtc_set_time(RTCState *s)
{
struct tm *tm = &s->current_tm;
- time_t before, after;
-
- before = mktime(tm);
+
tm->tm_sec = from_bcd(s, s->cmos_data[RTC_SECONDS]);
tm->tm_min = from_bcd(s, s->cmos_data[RTC_MINUTES]);
tm->tm_hour = from_bcd(s, s->cmos_data[RTC_HOURS] & 0x7f);
tm->tm_mday = from_bcd(s, s->cmos_data[RTC_DAY_OF_MONTH]);
tm->tm_mon = from_bcd(s, s->cmos_data[RTC_MONTH]) - 1;
tm->tm_year = from_bcd(s, s->cmos_data[RTC_YEAR]) + 100;
-
- /* Compute, and send, the additional time delta
- We could compute the total time delta, but this is
- sufficient, and simple. */
- after = mktime(tm);
- send_timeoffset_msg(after-before);
}
static void rtc_copy_date(RTCState *s)
time_t ti;
struct tm *tm;
int val;
- extern time_t timeoffset;
/* set the CMOS date */
time(&ti);
- ti += timeoffset;
if (rtc_utc)
tm = gmtime(&ti);
else
}
/* hd_table must contain 4 block drivers */
-static void cmos_init(uint64_t ram_size, char *boot_device, BlockDriverState **hd_table, time_t timeoffset)
+static void cmos_init(uint64_t ram_size, char *boot_device, BlockDriverState **hd_table)
{
RTCState *s = rtc_state;
int val;
static void pc_init1(uint64_t ram_size, int vga_ram_size, char *boot_device,
DisplayState *ds, const char **fd_filename, int snapshot,
const char *kernel_filename, const char *kernel_cmdline,
- const char *initrd_filename, time_t timeoffset,
+ const char *initrd_filename,
int pci_enabled)
{
#ifndef NOBIOS
floppy_controller = fdctrl_init(6, 2, 0, 0x3f0, fd_table);
- cmos_init(ram_size, boot_device, bs_table, timeoffset);
+ cmos_init(ram_size, boot_device, bs_table);
/* using PIIX4 acpi model */
if (pci_enabled && acpi_enabled)
int snapshot,
const char *kernel_filename,
const char *kernel_cmdline,
- const char *initrd_filename,
- time_t timeoffset)
+ const char *initrd_filename)
{
pc_init1(ram_size, vga_ram_size, boot_device,
ds, fd_filename, snapshot,
kernel_filename, kernel_cmdline,
- initrd_filename, timeoffset, 1);
+ initrd_filename, 1);
}
static void pc_init_isa(uint64_t ram_size, int vga_ram_size, char *boot_device,
int snapshot,
const char *kernel_filename,
const char *kernel_cmdline,
- const char *initrd_filename,
- time_t timeoffset)
+ const char *initrd_filename)
{
pc_init1(ram_size, vga_ram_size, boot_device,
ds, fd_filename, snapshot,
kernel_filename, kernel_cmdline,
- initrd_filename, timeoffset, 0);
+ initrd_filename, 0);
}
QEMUMachine pc_machine = {
int xc_handle;
-time_t timeoffset = 0;
-
char domain_name[1024] = { 'H','V', 'M', 'X', 'E', 'N', '-'};
extern int domid;
"-vnc display start a VNC server on display\n"
"-vncviewer start a vncviewer process for this domain\n"
"-vncunused bind the VNC server to an unused port\n"
- "-timeoffset time offset (in seconds) from local time\n"
#ifndef _WIN32
"-daemonize daemonize QEMU after initializing\n"
#endif
,
QEMU_OPTION_d,
QEMU_OPTION_vcpus,
- QEMU_OPTION_timeoffset,
QEMU_OPTION_acpi,
QEMU_OPTION_vncviewer,
QEMU_OPTION_vncunused,
{ "d", HAS_ARG, QEMU_OPTION_d },
{ "vcpus", 1, QEMU_OPTION_vcpus },
- { "timeoffset", HAS_ARG, QEMU_OPTION_timeoffset },
{ "acpi", 0, QEMU_OPTION_acpi },
{ NULL },
};
vcpus = atoi(optarg);
fprintf(logfile, "qemu: the number of cpus is %d\n", vcpus);
break;
- case QEMU_OPTION_timeoffset:
- timeoffset = strtol(optarg, NULL, 0);
- break;
case QEMU_OPTION_acpi:
acpi_enabled = 1;
break;
machine->init(ram_size, vga_ram_size, boot_device,
ds, fd_filename, snapshot,
- kernel_filename, kernel_cmdline, initrd_filename,
- timeoffset);
+ kernel_filename, kernel_cmdline, initrd_filename);
free(boot_device);
/* init USB devices */
char *boot_device,
DisplayState *ds, const char **fd_filename, int snapshot,
const char *kernel_filename, const char *kernel_cmdline,
- const char *initrd_filename, time_t timeoffset);
+ const char *initrd_filename);
typedef struct QEMUMachine {
const char *name;